#define  _CRT_SECURE_NO_WARNINGS

#include "SList.h"

void TestList1()
{
	//SListNode* phead = NULL;
	SListNode* pList = NULL;
	//...

	SListPushBack(&pList, 1);
	SListPushBack(&pList, 2);
	SListPushBack(&pList, 3);
	SListPushBack(&pList, 4);


	SListPrint(pList);

	//SListPopBack(&pList);
	//SListPopBack(&pList);
	//SListPopBack(&pList);
	//SListPopBack(&pList);
	//SListPopBack(&pList);

	//SListPrint(pList);
	SListPopFront(&pList);
	SListPopFront(&pList);
	SListPopFront(&pList);
	SListPopFront(&pList);
	SListPopFront(&pList);
	SListPushFront(&pList, 5);
	SListPushFront(&pList, 6);

	SListPrint(pList);
}

void TestList2()
{
	SListNode* pList = NULL;

	SListPushBack(&pList, 1);
	SListPushBack(&pList, 2);
	SListPushBack(&pList, 3);
	SListPushBack(&pList, 4);

	SListPrint(pList);

	SListNode* pos = SListFind(pList, 3);
	if (pos)
	{
		pos->data = 30;
	}
	SListInsertAfter(pos, 20);
	SListPrint(pList);







}



int main()
{
	//TestList1();
	TestList2();

	return 0;
}